#define _CRT_SECURE_NO_WARNINGS
#include "Heap.h"
void Test()
{
	Heap hp;
	HeapInit(&hp);
	HPDataType a[] = { 16,72,31,23,94,53 };
	for (int i = 0; i < sizeof(a) / sizeof(a[0]); ++i)
	{
		HeapPush(&hp, a[i]);
	}
	HPDataType top = HeapTop(&hp);
	printf("%d\n", top);
	HeapPrint(&hp);

	HeapPop(&hp);
	HeapPrint(&hp);

	HeapPop(&hp);
	HeapPrint(&hp);	

	HeapPop(&hp);
	HeapPrint(&hp);	

	HeapPop(&hp);
	HeapPrint(&hp);	

	HeapPop(&hp);
	HeapPrint(&hp);
}


int main()
{
	//Test();
	int a[] = { 3,1,7,5,2,9,4,6,8,0 };
	int sz = sizeof(a) / sizeof(a[0]);
	//PrintTopK(a, sz, 5);
	HeapSort(a, sz);
	for (int i = 0; i < sz; ++i)
	{
		printf("%d ", a[i]);
	}
	return 0;
}